package com.sc.design.state;

/**
 * @author sc
 * Created on  2017/12/7
 */
public class Context {
    public final static OpenState open = new OpenState();
    public final static CloseState close = new CloseState();
    public final static RunState run =  new RunState();
    public final static StopState stop = new StopState();

    private LiftState liftState;

    public LiftState getLiftState() {
        return liftState;
    }

    public void setLiftState(LiftState liftState) {
        this.liftState = liftState;
        this.liftState.setContext(this);
    }

    public void open(){
        this.liftState.open();
    }
    public void close(){
        this.liftState.close();
    }
    public void run(){
        this.liftState.run();
    }
    public void stop(){
        this.liftState.stop();
    }
}
